function test_SLICE2()
    data=D300F15();
    [corrplanes,sups]=SLICE2(data,1,0.00001,0.1);
    corratts={};
    for i=1:length(corrplanes)
        corratts{i}=[1,2,3];
    end
    displaycorrelations(corrplanes,sups,corratts,0.01, 'test_SLICE2.txt');
    plot3(data(:,1),data(:,2),data(:,3),'.');
    grid on;
end

function data=D300F15()
    numpoints = 100;
    noise_x=randint(1,numpoints,[-200,200]);
    noise_y=randint(1,numpoints,[-200,200]);
    noise_z=randint(1,numpoints,[-200,200]);
    
    x1=randint(1,numpoints/2,[-200,200]);
    y1=randint(1,numpoints/2,[-200,200]);
    z1=2*x1+y1; % 2x1+x2-x3=0
    
    x2=randint(1,numpoints,[-200,200]);
    y2=randint(1,numpoints,[-200,200]);
    z2=x2*3-y2*5+randn(1,numpoints); % 3x1-5x2-x3=0
    z2=randint(1,numpoints,[-200,200]);
    
    x3=randint(1,numpoints,[-200,200]);
    y3=randint(1,numpoints,[-200,200]);
    z3=-4*x3-2*y3+100+randn(1,numpoints)*4; % 4x1+2x2+x3=100
    
    x=[noise_x,x1,x2,x3];
    y=[noise_y,y1,y2,y3];
    z=[noise_z,z1,z2,z3];
    data=[ x',y',z'];
end
